package com.cictec.middleware.ribbon.configuration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

import com.cictec.middleware.ribbon.loadbalancer.rule.MiddlewareGPSRule;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.IRule;

import feign.Logger;

/**
 * middleware-dc 服务Ribbon配置项
 * 
 * @author Administrator
 *
 */
public class MiddlewareGpsRibbonConfiguration {

	@Autowired
	private IClientConfig ribbonClientConfig;

	@Bean
	public IRule ribbonRule(IClientConfig config) {

		// 调用时候使用自定义middleware-dc服务的负载均衡规则
		return new MiddlewareGPSRule();
	}

	@Bean
	Logger.Level feginLoggerLevel() {
		return Logger.Level.FULL;
	}
}
